/**
 * 2
 *  
 * @Author : Ruoyu Wang
 * @DateTime : 24-10-28 下午6:57
 */

#include <iostream>
#include <string>

using namespace std;

int main() {
    int n, k;
    string s;
    cin >> n >> k >> s;

    int idx = 0;
    bool flag = true;

    while (idx < s.size() && k > 0) {
        k--;
        int x = flag ? 1 : 0;
        while (idx < s.size() && s[idx] == x + '0') {
            idx++;
        }
        flag = !flag;
    }

    if (idx == s.size()) {
        int res = 0;
        res += k % 2;
        cout << res << endl;
        return 0;
    }

    if (!flag) {
        for (int i = idx; i < s.size(); ++i) {
            s[i] = (s[i] == '0') ? '1' : '0';
        }
    }

    cout << s.substr(idx) << endl;
    return 0;
}

